package com.yangbo.controller;

import com.alibaba.fastjson.JSONArray;
import com.yangbo.service.GithubSearchApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangbo
 * @date 2019-09-06 9:30
 */
@RestController
public class GithubApiController {

    @Autowired
    private GithubSearchApiService apiService;

    @GetMapping(value = "/search")
    public ResponseEntity getStr() {
            return ResponseEntity.ok().body(JSONArray.parse(apiService.getStr()));
    }
}
